#ifndef __CORE_ROTATION__
#define __CORE_ROTATION__
#include "Vector3.h"
#include "Matrix3.h"
namespace Core
{
	class rtAngles;
	class rtRotation;
	class rtQuaternions;
	class rtMatrix4;

	class rtRotation
	{
	public:
		friend class rtAngles;
		friend class rtQuaternions;
		friend class rtMatrix3;

	public:
		rtRotation(void);
		rtRotation(const rtVector3& rotationOrigin, const rtVector3& rotationVec, const float rotationAngle);

		void				set(const rtVector3& rotationOrigin, const rtVector3& rotationVec, const float rotationAngle);
		void				setOrigin(const rtVector3& rotationOrigin);
		void				setVec(const rtVector3& rotationVec);
		void				setVec(const float x, const float y, const float z);
		void				setAngle(const float rotationAngle);
		void				scale(const float s);
		void				reCalculateMatrix(void);
		const rtVector3&	getOrigin(void) const;
		const rtVector3&	getVec(void) const;
		float				getAngle(void) const;

		rtRotation			operator - () const;
		rtRotation			operator * (const float s) const;
		rtRotation			operator / (const float s) const;
		rtRotation&		    operator *= (const float s);
		rtRotation&		    operator /= (const float s);
		rtVector3			operator * (const rtVector3 &v) const;

		friend rtRotation	operator * (const float s, const rtRotation& r);
		friend rtVector3		operator * (const rtVector3& v, const rtRotation& r);
		friend rtVector3&	operator *= (rtVector3& v, const rtRotation& r);

		rtAngles			toAngles(void) const;
		rtQuaternions		toQuat(void) const;
		const rtMatrix3&	toMat3(void) const;
		rtMatrix4			toMat4(void) const;
		rtVector3			toAngularVelocity(void) const;

		void				rotatePoint(rtVector3& point) const;

		void				normalize180(void);
		void				normalize360(void);

	private:
		rtVector3				m_Origin;
		rtVector3				m_Vec;
		float				    m_Angle;
		mutable rtMatrix3		m_Axis;
		mutable bool		    m_AxisValid;
	};



}
#endif


